package io.a.a

object practise2 {
  def practise2(str: String): Boolean = {
    val len = str.length
    val halfLen = len / 2
    for (i <- 0 until halfLen) {
      if (str(i) != str(len - i - 1)) {
        return false
      }
    }
    true
  }

  def main(args: Array[String]): Unit = {
    println(practise2("racecar")) // true
    println(practise2("hello")) // false
  }
}
